package com.tydic.oa.mixture;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class TestSP {

    public static void main(String[] args) {
        String s1 = "aaaaa";
        StringBuffer s2 = new StringBuffer("bbbbb NAme Like '%????%' hfghd");
        s1 = s2.substring(s2.indexOf("'%")+2, s2.indexOf("%'"));
        String r = null;
        int i = 3694;
        r = s1 + i + s2;
        System.out.println("s1="+s1);
        
        
        String str1 = "XYZ010";
        
        int index = str1.indexOf("01");
        
        String subStr1 = str1.substring(index+1, str1.length());
        
        System.out.println(index+" "+subStr1);
        
        File file = new File("d:/script.sql");
        boolean flag = file.exists();
        
        System.out.println("flag="+flag);
        
        try {
			file.createNewFile();
			Writer writer = new FileWriter(file);
			BufferedWriter in = new BufferedWriter(writer);
			
			in.append("======================");
			//in.write("---------------");
			
			in.flush();
			in.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        
    }

}
